mcs_app.service('authenticationService',  function($http) {

	function doCallBack(callback, data) {
		if (callback) {
			callback(data);
		}
	}

	function login (user, successCallBack,  errorCallBack) {
		$http.post('api/auth', user).success(function (data) {
			doCallBack(successCallBack, data);
		}).error(function (data) {
			doCallBack(errorCallBack, data);
		});
	}
});